const { validator } = require('../validator')

//
const createValidator = validator({
  uav_id: { type: 'string', max: 32, required: true },
  uav_name: { type: 'string', max: 32, required: false },
  lat: { type: 'number', required: true },
  lng: { type: 'number', required: true },
  alt: { type: 'number', required: true },
  speed: { type: 'number', required: false },
})

const getValidator = validator({
  id: { type: 'int', required: true },
})

const delValidator = validator({
  id: { type: 'int', required: true },
})

const listValidator = validator({
  pageNo: { type: 'int', required: true },
  pageSize: { type: 'int', required: true },
})

const listByUasIdAndDateValidator = validator({
  date: { type: 'string', required: true },
  uas_id: { type: 'int', required: true },
})

module.exports = {
  getValidator,
  createValidator,
  delValidator,
  listValidator,
  listByUasIdAndDateValidator,
}
